<template>
  <a-card :bordered="false" class="withdrawal">
    <div class="theknightSearch table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="getList">
        <a-row :gutter="24">
          <a-col :md="5" :sm="5">
            <a-form-item label="订单号" :labelCol="{span: 6}" :wrapperCol="{span: 14, offset: 1}">
              <a-input placeholder="请输入订单号" v-model="queryParam.orderNo"></a-input>
            </a-form-item>
          </a-col>
          <a-col :md="5" :sm="5">
            <a-form-item label="下单人手机号" :labelCol="{span: 6}" :wrapperCol="{span: 14, offset: 1}">
              <a-input placeholder="请输入骑士手机号" v-model="queryParam.riderMobile"></a-input>
            </a-form-item>
          </a-col>
          <a-col :md="12" :sm="12">
            <a-button type="primary" @click="getList" icon="search">搜索</a-button>
            <a-button style="margin-left: 8px" @click="getList">刷新</a-button>
            <a-button style="margin-left: 8px" @click="getList">查看详情</a-button>
            <a-button style="margin-left: 8px" @click="getList">订单指派</a-button>
          </a-col>
        </a-row>
      </a-form>
    </div>
    <section class="table">
      <a-table ref="table" size="middle" bordered rowKey="id" :columns="columns" :pagination="ipagination"
        :rowSelection="{selectedRowKeys:selectedRowKeysArrey,onChange:onSelectChange,type:'radio'}" @change="changePage"
        :dataSource="List" :loading="loading">
      </a-table>
    </section>
  </a-card>
</template>
<script>
import {
  postAction,
  getAction
} from '@/api/manage'
import store from '@/store'
export default {
  data() {
    return {
      loading: false,
      queryParam: {},
      List: [{
        id: '1'
      }, {
        id: "2"
      }],
      selectedRowKeysArrey: [], //选中的id
      chooseOrder: '', // 选中的数据
      isBranchFlag: false,// 当前登录用户是否分站用户
      columns: [
        {
          title: '订单号',
          align: "center",
          dataIndex: 'id',
        },
        {
          title: '订单类型',
          align: "center",
          dataIndex: 'fee',
        },
        {
          title: '会员手机号',
          align: "center",
          dataIndex: 'payId',
        },
        {
          title: '订单价格',
          align: "center",
          dataIndex: 'creat1eBy',
        },
        {
          title: '状态',
          align: "center",
          dataIndex: 'cre2ateBy',
        },
        {
          title: '下单视觉',
          align: "center",
          dataIndex: 'crea3teBy',
        }
      ],
      //标记页数；页码
      ipagination: {
        current: 1,
        showQuickJumper: true,
        showSizeChanger: true,
        showTotal: (total, range) => {
          return range[0] + "-" + range[1] + " 共" + total + "条"
        },
        total: 0
      },

      url: {

      }
    }
  },
  created() {
    console.log(this.$store.state.user.info.branchId, "获取当前登录用户的分站");
    const ut = store.getters.userInfo.userType;
    this.isBranchFlag = (ut == 2 || ut == 3) ? true : false;
    if (this.isBranchFlag) {
      this.queryParam.branchId = store.getters.userInfo.branchId;
    }
    // this.getList()
  },
  methods: {
    getList() {

    },
    onClose() {
    },
    // 选中一行
    onSelectChange(a, b) {
      this.selectedRowKeysArrey = a;
      this.chooseOrder = b[0];
      console.log(this.chooseOrder, "选中的数据");
      this.add = this.chooseOrder
    },
    // 代理列表改变分页
    changePage(pagination) {
      console.log(pagination);
      this.ipagination.current = pagination.current
      this.queryParam.pageNo = pagination.current;
      this.queryParam.pageSize = pagination.pageSize;
      this.getList();
    },
  }
}
</script>
<style lang="less" scoped>
.modal {
  .modeal-title {
    text-align: center;
    font-size: 20px;
    font-weight: 700;
  }
  button {
    position: absolute;
    right: 50px;
  }
  .pooltable {
    padding-top: 50px;
  }
}

.withdrawal {
  .time {
    margin-top: 30px;
  }
  .theknightSearch {
    padding: 15px 10px;
    .ant-form-item {
      width: 100%;
    }
  }
  .table-page-search-wrapper .ant-form-inline .ant-form-item {
    margin-bottom: 0px !important;
  }
}
</style>